import React, {Component} from 'react'
import {
    Text,
    Image,
    View,
    StyleSheet,
    Button
} from 'react-native'

export default class Page1 extends Component {
    constructor(props) {
        super(props)

    }

    render() {
        const {navigation} = this.props;
        return (
            <View>
                <Text style={styles.text}>
                    欢迎来到page1
                </Text>

                <Button
                title = "Go back"
                onPress={() =>{
                    navigation.goBack();
                }}
                >

                </Button>

                <Button
                    title='go to page2'
                    onPress={()=>{
                        navigation.navigate("Page2");
                    }}
                />


            </View>
        )
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        backgroundColor: '#F5FCFF',
    },
    page1: {
        flex: 1,
        backgroundColor: 'red'
    },
    page2: {
        flex: 1,
        backgroundColor: 'blue'
    },
    image: {
        width: 22,
        height: 22
    },
    text : {
        fontSize: 20,
        color: 'black'
    }
})